package com.ecr.hub.service.hub;

import java.util.Date;
import java.util.List;

import com.ecr.hub.ApplicationException;
import com.ecr.hub.model.composition.Composition;
import com.ecr.hub.model.enumeration.HubStack;
import com.ecr.hub.model.enumeration.HubWagonTrailer;
import com.ecr.hub.model.hub.HubTrafficController;
import com.ecr.hub.model.rail.Rail;
import com.ecr.hub.model.sillon.Sillon;
import com.ecr.hub.model.user.User;
import com.ecr.hub.model.wagon.Wagon;
import com.ecr.hub.model.wagon.WagonStatus;
import com.ecr.hub.model.wagon.WagonType;

public interface IHubManager {

	public HubTrafficController getHub() throws ApplicationException;

	public List<Composition> getWorkingPlan(
			HubTrafficController trafficController, Sillon sillon)
			throws ApplicationException;

	public List<Composition> getPlan(Sillon sillon) throws ApplicationException;

	public void requestWorkingPlan(HubTrafficController trafficController,
			Sillon sillon, List<Composition> lstCompositions)
			throws ApplicationException;

	public void completeWorkingPlan(HubTrafficController trafficController,
			Sillon sillon) throws ApplicationException;

	public void moveWagon(HubTrafficController trafficController, Wagon wagon,
			HubStack stack) throws ApplicationException;

	public void reverseSense(Sillon sillon) throws ApplicationException;

	public String displayWorkingPlanPdf(User user, Sillon sillon)
			throws ApplicationException;

	public void completeArrival(HubTrafficController trafficController,
			Sillon sillon) throws ApplicationException;

	public List<WagonStatus> getListWagonStatus(HubWagonTrailer trailer)
			throws ApplicationException;

	public List<WagonType> getListWagonTypes(HubWagonTrailer trailer)
			throws ApplicationException;

	public List<Wagon> getListWagonsForRail(Rail rail)
			throws ApplicationException;

	public void refreshHub(HubTrafficController trafficController)
			throws ApplicationException;

	public void updateTraffic(HubTrafficController trafficController)
			throws ApplicationException;

	public List<Sillon> checkDepartures() throws ApplicationException;

	public List<Sillon> checkArrivals() throws ApplicationException;

	public void updateSillonComment(Sillon sillon) throws ApplicationException;

	public void checkRail(HubTrafficController trafficController,
			Sillon sillon, int railId, int typeCheckRail)
			throws ApplicationException;

	public String findWagonInTraffic(HubTrafficController trafficControler,
			String wagonExtId) throws ApplicationException;

	public Sillon getSillonByExtIdAndDate(String sillonExtId, Date dateSillon)
			throws ApplicationException;

	public Sillon getSillonByTcmsTrainId(String tcmsTrainId)
			throws ApplicationException;

	public List<Sillon> getListSillonsByDateAndTime(Date date, Date dateEnd,
			String time, String timeEnd, String type)
			throws ApplicationException;

	public void processWorkingPlan(HubTrafficController trafficController,
			Sillon sillon) throws ApplicationException;

	public void deleteSillon(HubTrafficController trafficController,
			Sillon sillon) throws ApplicationException;

	public void initSillon(HubTrafficController trafficController, Sillon sillon)
			throws ApplicationException;

	public void addWagon(HubTrafficController trafficController, Wagon wagon)
			throws ApplicationException;

	public void deleteWagon(HubTrafficController trafficController, Wagon wagon)
			throws ApplicationException;

	public void getFormationPlanPhaseOne(
			HubTrafficController trafficController, Sillon sillon)
			throws ApplicationException;

	public List<Composition> getFormationPlanPhaseTwo(
			HubTrafficController controller, Sillon sillon)
			throws ApplicationException;

	public void processFormationPlan(HubTrafficController trafficController,
			List<Composition> lstCompositions, Sillon sillon)
			throws ApplicationException;

	public String displayFormationPlanPdf(User user, Sillon sillon)
			throws ApplicationException;

	public void completeFormationPlan(HubTrafficController trafficController,
			Sillon sillon) throws ApplicationException;

	public void requestDeparture(HubTrafficController trafficController,
			Sillon sillon) throws ApplicationException;

	public void processDeparture(HubTrafficController trafficController,
			Sillon sillon) throws ApplicationException;

	public void completeDeparture(HubTrafficController trafficController,
			Sillon sillon) throws ApplicationException;

	public String displayCompositionPlanPdf(User user, Sillon sillon)
			throws ApplicationException;

	public void checkWagonNotInFormationPlan(Wagon wagon)
			throws ApplicationException;

	public void updateWagon(HubTrafficController trafficController, Wagon wagon)
			throws ApplicationException;

	public void updateWagons(HubTrafficController trafficController, Rail rail,
			int targetRailId, int statusId, int nWagonsStack)
			throws ApplicationException;

	public void integrateSillons(List<Sillon> lstSillons)
			throws ApplicationException;

	public void integrateComposition(List<Composition> lstComposition,
			String tcmsTrainId, String fileStoreName)
			throws ApplicationException;

	public void updateRailAvailable(Rail rail) throws ApplicationException;

	public void sendCompositionMail(User user) throws ApplicationException;
}
